/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {

  const { router, controller, middleware } = app;
  const verify_token = middleware.verifyToken(app.config.jwt.secret); // 校验token
  router.get('/wechat', controller.wechatController.validate);
  router.get('/wechat/createMenu', controller.wechatController.createMenu);
  router.get('/wechat/auth', controller.wechatController.auth);
  router.get('/wechat/auth/callback', controller.wechatController.callback);
  router.post('/cms/login', controller.login.login); //登录--登录
  router.post('/cms/getList', controller.machineWarehousing.getWarehousingList); //极具入库--查询列表
  router.post('/cms/agencyList', controller.machineModel.agencyList); //机具型号列表--查询第三方机构
  router.post('/cms/machineList', controller.machineModel.machineList); //机具型号列表--查询
  router.post('/cms/createModel', controller.machineModel.createModel); //机具型号列表--新增
  router.post('/cms/updateModel', controller.machineModel.updateModel); //机具型号列表--更新
  router.delete('/cms/deleteModel', controller.machineModel.deleteModel); //机具型号列表--删除
  router.post('/cms/createMachineStore', controller.machineWarehousing.createMachineStore) //机具型号新增
  router.delete('/cms/deleteMachineStore', controller.machineWarehousing.deleteMachineStore) //机具型号新增
  // router.get('/api/user', controller.home.index);
};
